import java.awt.Font;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;


public class Rectframe extends Frame{
	
	public void paint(Graphics g) {
		int x1=100;
		int y1=100;
		int x2=150;
		int y2=150;
		g.drawRect(x1, y1, Math.abs(x2 - x1) - 1, Math.abs(y2 - y1) - 1);
	}
	
	public static void main(String arg[]) {
		Rectframe f = new Rectframe();
		f.setBounds(50, 50, 500, 500);
		f.setVisible(true);
		f.addWindowListener(new WindowAdapter() {
			public void windowClosing(WindowEvent we) {
				System.exit(0);
			}
		});
	}

}
